Date: 2018-11-16
R version: 3.5.0
*Corresponding author: matthew.malishev@gmail.com
This document can be found at https://github.com/darwinanddavis/SchistoIBM/tree/master/mac

 

R session info

params$session
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.5.0  backports_1.1.2 magrittr_1.5    rprojroot_1.3-2 tools_3.5.0     htmltools_0.3.6
 [7] yaml_2.2.0      Rcpp_0.12.19    stringi_1.2.3   rmarkdown_1.10  knitr_1.20      stringr_1.3.1  
[13] digest_0.6.15   evaluate_0.10.1

Overview

This document showcases why R is dope.

You can write in-line code, equations like this \(E = mc^{2}\), create links to your website.

Just like LateX, but more versatile.

Create quoted text

Pump the bass in the trunk //
It rattled like a baby hand //
Except this toy cost 80 grand //
And I’m crazy tan, from all the places that I’ve been //
Just from writing words with a pen //

Define equations
\[ t'= \frac {1} { \sqrt{1 - \frac {v^{2}} {c^{2}} } } \]

Embed images/gifs:

Science.

Embed code from different languages.

This is R code

if(pck==1){
  p<-c("rJava", "RNetLogo"); remove.packages(p)
  # then install rJava and RNetLogo from source
  install.packages("rJava", repos = "https://cran.r-project.org/", type="source"); library(rJava)
  install.packages("RNetLogo", repos = "https://cran.r-project.org/", type="source"); library(RNetLogo)
}

shell/bash

echo "Hello Bash!"  
pwd # check working dir
git init # initialise git

Octave (and MATLAB from the RMatlab package).
RMatlab documentation.

b = [4; 9; 2] # Column vector
A = [ 3 4 5;
      1 3 1;
      3 5 9 ]
x = A \ b     # Solve the system Ax = b

HTML

<!-- links-->
        <div class="footer">
            <a href="dd_feed.html" 
            class="transition fade_in">
                Latest post
            </a>
            &nbsp; &nbsp; &nbsp;
            <a href="dd_contact.html" 
            class="transition fade_in">
                Contact
            </a>
            &nbsp; &nbsp; &nbsp;
            <a href="dd_subscribe.html"
            class="transition fade_in">
                Subscribe
            </a>
        </div>

CSS

body {
  color: red;
}

Javascript to access html and css

$('.title').css('color', 'red')

Python

x = 'hello, python world!'
print(x.split(' '))

Here’s a complete list of available languages

names(knitr::knit_engines$get())
 [1] "awk"       "bash"      "coffee"    "gawk"      "groovy"    "haskell"   "lein"      "mysql"    
 [9] "node"      "octave"    "perl"      "psql"      "Rscript"   "ruby"      "sas"       "scala"    
[17] "sed"       "sh"        "stata"     "zsh"       "highlight" "Rcpp"      "tikz"      "dot"      
[25] "c"         "fortran"   "fortran95" "asy"       "cat"       "asis"      "stan"      "block"    
[33] "block2"    "js"        "css"       "sql"       "go"        "python"    "julia"    

All from R!